<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProjectProductsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('project_products', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('project_id')->comment('项目ID');
            $table->unsignedInteger('product_id')->comment('产品ID');
            $table->string('case_total')->nullable()->comment('例数');
            $table->unsignedInteger('money')->nullable()->comment('约定价格');
            $table->text('special_remark')->nullable()->comment('特殊备注');
            $table->text('remark')->nullable()->comment('普通备注');
            $table->unsignedInteger('created_by')->comment('创建者');
            $table->unsignedInteger('updated_by')->comment('更新者');
            $table->string('data_scope')->nullable()->comment('数据域');
            $table->timestamps();

            $table->comment = '项目产品表';
            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('project_products');
    }

}
